<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org">
<TITLE>Patterns Format</TITLE>
<META name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
<LINK rel="HOME" title="Abyss Web Server For Windows User's Guide" href="index.html">
<LINK rel="PREVIOUS" title="IP Addresses and Ranges Format" href="ipformat.html">
<LINK rel="NEXT" title="Regular Expressions" href="regex.html">
<LINK rel="STYLESHEET" type="text/css" href="stylesheet.css">
<META name="AppleIcon" content="icon.png">
<META name="AppleTitle" content="Abyss Web Server Help">
</HEAD>
<BODY class="APPENDIX" bgcolor="#FFFFFF" text="#000000">
<DIV class="NAVHEADER">
<TABLE summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TH colspan="3" align="center">Abyss Web Server For Windows User's Guide</TH>
</TR>
<TR>
<TD width="10%" align="left" valign="bottom"><A href="ipformat.html" accesskey="P">Prev</A></TD>
<TD width="80%" align="center" valign="bottom"></TD>
<TD width="10%" align="right" valign="bottom"><A href="regex.html" accesskey="N">Next</A></TD>
</TR>
</TABLE>
<HR align="left" width="100%"></DIV>
<DIV class="APPENDIX">
<H1><A name="PATTERNSFORMAT" id="PATTERNSFORMAT"></A>Appendix D. Patterns Format</H1>
<P>When matching a string (a sequence of characters containing an extension or a virtual path) with a pattern, the following rules apply:</P>
<UL>
<LI>
<P><KBD class="USERINPUT">*</KBD> matches any sequence of characters with any length (zero or more),</P>
</LI>
<LI>
<P><KBD class="USERINPUT">?</KBD> matches any character,</P>
</LI>
<LI>
<P><KBD class="USERINPUT">[</KBD>set<KBD class="USERINPUT">]</KBD> matches any character in the specified set,</P>
</LI>
<LI>
<P><KBD class="USERINPUT">[!</KBD>set<KBD class="USERINPUT">]</KBD> or <KBD class="USERINPUT">[^</KBD>set<KBD class="USERINPUT">]</KBD> matches any character not in the specified set,</P>
</LI>
<LI>
<P><KBD class="USERINPUT">\</KBD> suppresses the syntactic significance of a special character.</P>
</LI>
</UL>
<P>A set is made of characters or ranges. A range is formed by two characters with a <KBD class="USERINPUT">-</KBD> in the middle (as in <KBD class="USERINPUT">0-9</KBD> or <KBD class="USERINPUT">a-z</KBD>).</P>
<P>Preceding a special character with <KBD class="USERINPUT">\</KBD> makes it loose its syntactic significance and match that character exactly. The special characters are <KBD class="USERINPUT">[]*?!^-\</KBD>.</P>
<DIV class="EXAMPLE"><A name="AEN2984" id="AEN2984"></A>
<P><B>Example D-1. Examples of Patterns</B></P>
<UL>
<LI>
<P><KBD class="USERINPUT">*</KBD>: any string including the empty string matches with this pattern.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">*.*</KBD>: <KBD class="USERINPUT">list.txt</KBD> and <KBD class="USERINPUT">holiday.jpeg</KBD> match while <KBD class="USERINPUT">my-directory</KBD> doesn't.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">/*.php</KBD>: <KBD class="USERINPUT">/hello.php</KBD> and <KBD class="USERINPUT">/mysite/scripts/test.php</KBD> match but <KBD class="USERINPUT">/mysite/test2.pl</KBD> doesn't.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">/*/*.php</KBD>: <KBD class="USERINPUT">/mysite/test.php</KBD> and <KBD class="USERINPUT">/mysite/scripts/test.php</KBD> match with this pattern while <KBD class="USERINPUT">/test.php</KBD> doesn't.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">mp?</KBD>: Any 3 character long string that begins with <KBD class="USERINPUT">mp</KBD> matches.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">?????</KBD>: Any 5 character long string matches.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">mp[2-4]</KBD>: Only <KBD class="USERINPUT">mp2</KBD>, <KBD class="USERINPUT">mp3</KBD>, and <KBD class="USERINPUT">mp4</KBD> match.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">mp[!2-4]</KBD>: All 3 character long strings that begin with <KBD class="USERINPUT">mp</KBD> match except <KBD class="USERINPUT">mp2</KBD>, <KBD class="USERINPUT">mp3</KBD>, and <KBD class="USERINPUT">mp4</KBD>.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">mp[2-4g]</KBD>: Only <KBD class="USERINPUT">mp2</KBD>, <KBD class="USERINPUT">mp3</KBD>, <KBD class="USERINPUT">mp4</KBD>, and <KBD class="USERINPUT">mpg</KBD> match.</P>
</LI>
<LI>
<P><KBD class="USERINPUT">mp[2\-4]file</KBD>: Only <KBD class="USERINPUT">mp2file</KBD>, <KBD class="USERINPUT">mp-file</KBD>, and <KBD class="USERINPUT">mp4file</KBD> match.</P>
</LI>
</UL>
</DIV>
</DIV>
<DIV class="NAVFOOTER">
<HR align="left" width="100%">
<TABLE summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="33%" align="left" valign="top"><A href="ipformat.html" accesskey="P">Prev</A></TD>
<TD width="34%" align="center" valign="top"><A href="index.html" accesskey="H">Home</A></TD>
<TD width="33%" align="right" valign="top"><A href="regex.html" accesskey="N">Next</A></TD>
</TR>
<TR>
<TD width="33%" align="left" valign="top">IP Addresses and Ranges Format</TD>
<TD width="34%" align="center" valign="top">&nbsp;</TD>
<TD width="33%" align="right" valign="top">Regular Expressions</TD>
</TR>
</TABLE>
</DIV>
<DIV class="COPYRIGHT">Copyright &copy; 2001-2009 Aprelium</DIV>
</BODY>
</HTML>
